﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
using BLL;
using Model;
using NS.Model.Systems;
using NS.BLL.Systems;
using NS.Utilities;

public partial class Systems_InfoManager : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            GridViewDataBind();
        }
    }
    //绑定数据源
    private void GridViewDataBind()
    {
        FGridView1.SQLString = InfoService.GetAllInfo_SQL();
        FGridView1.PKey = "ID";
        FGridView1.OrderName = "ID";
        FGridView1.BindData();
        FGridView1.AddControl();
    }
    //删除数据
    protected void DelButton_Click(object sender, EventArgs e)
    {
        string ID = ((Button)sender).CommandArgument.ToString();
        InfoService.DeleteInfoById(int.Parse(ID));
        GridViewDataBind();
        FGridView1.AddControl();
    }
    //修改后重新绑定数据
    protected void btnBindData_Click(object sender, EventArgs e)
    {
        GridViewDataBind();
        FGridView1.AddControl();
    }
}